session.h revision 0bbfda8a
1/* 2 * Copyright 2004 Richard Levitte 3 */ 4 5#ifndef _CTWM_SESSION_H 6#define _CTWM_SESSION_H 7 8#include <stdio.h> // For FILE 9 10#include <X11/SM/SMlib.h> 11 12 13/* Used in stashing session info */ 14struct TWMWinConfigEntry { 15 struct TWMWinConfigEntry *next; 16 int tag; 17 char *client_id; 18 char *window_role; 19 XClassHint class; 20 char *wm_name; 21 int wm_command_count; 22 char **wm_command; 23 short x, y; 24 unsigned short width, height; 25 short icon_x, icon_y; 26 bool iconified; 27 bool icon_info_present; 28 bool width_ever_changed_by_user; 29 bool height_ever_changed_by_user; 30 /* ===================[ Matthew McNeill Feb 1997 ]======================= * 31 * Added this property to facilitate restoration of workspaces when 32 * restarting a session. 33 */ 34 int occupation; 35 /* ====================================================================== */ 36 37}; 38 39 40/* XXX Only used in one place, should convert to a func? */ 41extern SmcConn smcConn; 42 43char *GetClientID(Window window); 44char *GetWindowRole(Window window); 45int WriteWinConfigEntry(FILE *configFile, TwmWindow *theWindow, 46 char *clientId, char *windowRole); 47int ReadWinConfigEntry(FILE *configFile, unsigned short version, 48 TWMWinConfigEntry **pentry); 49void ReadWinConfigFile(char *filename); 50int GetWindowConfig(TwmWindow *theWindow, 51 short *x, short *y, 52 unsigned short *width, unsigned short *height, 53 bool *iconified, 54 bool *icon_info_present, 55 short *icon_x, short *icon_y, 56 bool *width_ever_changed_by_user, 57 bool *height_ever_changed_by_user, 58 int *occupation /* <== [ Matthew McNeill Feb 1997 ] == */ 59 ); 60void SaveYourselfPhase2CB(SmcConn smcCon, SmPointer clientData); 61void DieCB(SmcConn smcCon, SmPointer clientData); 62void SaveCompleteCB(SmcConn smcCon, SmPointer clientData); 63void ShutdownCancelledCB(SmcConn smcCon, SmPointer clientData); 64void ProcessIceMsgProc(XtPointer client_data, int *source, XtInputId *id); 65void ConnectToSessionManager(char *previous_id); 66 67#endif /* _CTWM_SESSION_H */ 68