session.h revision 645f5050
1/*
2 *  [ ctwm ]
3 *
4 *  Copyright 2004 Richard Levitte
5 *
6 * Permission to use, copy, modify  and distribute this software  [ctwm] and
7 * its documentation for any purpose is hereby granted without fee, provided
8 * that the above  copyright notice appear  in all copies and that both that
9 * copyright notice and this permission notice appear in supporting documen-
10 * tation, and that the name of  Claude Lecommandeur not be used in adverti-
11 * sing or  publicity  pertaining to  distribution of  the software  without
12 * specific, written prior permission. Claude Lecommandeur make no represen-
13 * tations  about the suitability  of this software  for any purpose.  It is
14 * provided "as is" without express or implied warranty.
15 *
16 * Claude Lecommandeur DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 * INCLUDING ALL  IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS.  IN NO
18 * EVENT SHALL  Claude Lecommandeur  BE LIABLE FOR ANY SPECIAL,  INDIRECT OR
19 * CONSEQUENTIAL  DAMAGES OR ANY  DAMAGES WHATSOEVER  RESULTING FROM LOSS OF
20 * USE, DATA  OR PROFITS,  WHETHER IN AN ACTION  OF CONTRACT,  NEGLIGENCE OR
21 * OTHER  TORTIOUS ACTION,  ARISING OUT OF OR IN  CONNECTION WITH THE USE OR
22 * PERFORMANCE OF THIS SOFTWARE.
23 *
24 * Author:  Richard Levitte [ richard@levitte.org ][ June 2004 ]
25 */
26
27#include <stdio.h>
28#ifdef VMS
29#  include <X11SM/SMlib.h>
30#else
31#  include <X11/SM/SMlib.h>
32#endif
33#include "types.h"
34
35#ifndef _SESSION_
36#define _SESSION_
37
38extern SmcConn smcConn;
39extern XtInputId iceInputId;
40extern char *twm_clientId;
41extern TWMWinConfigEntry *winConfigHead;
42extern Bool gotFirstSave;
43extern Bool sent_save_done;
44
45char *GetClientID (Window window);
46char *GetWindowRole (Window window);
47int WriteWinConfigEntry (FILE *configFile, TwmWindow *theWindow,
48			 char *clientId, char *windowRole);
49int ReadWinConfigEntry (FILE *configFile, unsigned short version,
50			TWMWinConfigEntry **pentry);
51void ReadWinConfigFile (char *filename);
52int GetWindowConfig (TwmWindow *theWindow,
53		     short *x, short *y,
54		     unsigned short *width, unsigned short *height,
55		     Bool *iconified,
56		     Bool *icon_info_present,
57		     short *icon_x, short *icon_y,
58		     Bool *width_ever_changed_by_user,
59		     Bool *height_ever_changed_by_user,
60		     int *occupation /* <== [ Matthew McNeill Feb 1997 ] == */
61		     );
62void SaveYourselfPhase2CB (SmcConn smcCon, SmPointer clientData);
63void SaveYourselfCB (SmcConn smcCon, SmPointer clientData,
64		     int saveType, Bool shutdown,
65		     int interactStyle, Bool fast);
66void DieCB (SmcConn smcCon, SmPointer clientData);
67void SaveCompleteCB (SmcConn smcCon, SmPointer clientData);
68void ShutdownCancelledCB (SmcConn smcCon, SmPointer clientData);
69void ProcessIceMsgProc (XtPointer client_data, int *source, XtInputId *id);
70void ConnectToSessionManager (char *previous_id);
71
72#endif /* _SESSION_ */
73
74