session.h revision df1c27a6
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// Guard
13#ifndef SESSION
14#error "You're unconditionally including session.h!"
15#endif
16
17
18/* Used in stashing session info */
19struct TWMWinConfigEntry {
20	struct TWMWinConfigEntry *next;
21	int tag;
22	char *client_id;
23	char *window_role;
24	XClassHint class;
25	char *wm_name;
26	int wm_command_count;
27	char **wm_command;
28	short x, y;
29	unsigned short width, height;
30	short icon_x, icon_y;
31	bool iconified;
32	bool icon_info_present;
33	bool width_ever_changed_by_user;
34	bool height_ever_changed_by_user;
35	/* ===================[ Matthew McNeill Feb 1997 ]======================= *
36	 * Added this property to facilitate restoration of workspaces when
37	 * restarting a session.
38	 */
39	int occupation;
40	/* ====================================================================== */
41
42};
43typedef struct TWMWinConfigEntry TWMWinConfigEntry;
44
45
46void ReadWinConfigFile(char *filename);
47int GetWindowConfig(TwmWindow *theWindow,
48                    short *x, short *y,
49                    unsigned short *width, unsigned short *height,
50                    bool *iconified,
51                    bool *icon_info_present,
52                    short *icon_x, short *icon_y,
53                    bool *width_ever_changed_by_user,
54                    bool *height_ever_changed_by_user,
55                    int *occupation /* <== [ Matthew McNeill Feb 1997 ] == */
56                   );
57void ConnectToSessionManager(char *previous_id);
58void shutdown_session(void);
59
60#endif /* _CTWM_SESSION_H */
61