|
CTWM
|
#include "ctwm.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <sys/stat.h>#include <limits.h>#include <X11/Xatom.h>#include "ctwm_atoms.h"#include "ctwm_shutdown.h"#include "icons.h"#include "list.h"#include "screen.h"#include "session.h"Go to the source code of this file.
Macros | |
| #define | SAVEFILE_VERSION 2 |
| #define | PATH_MAX 1023 |
Functions | |
| static void | SaveYourselfCB (SmcConn smcCon, SmPointer clientData, int saveType, Bool shutdown, int interactStyle, Bool fast) |
| static char * | GetClientID (Window window) |
| static char * | GetWindowRole (Window window) |
| static int | WriteWinConfigEntry (FILE *configFile, TwmWindow *theWindow, char *clientId, char *windowRole) |
| static int | ReadWinConfigEntry (FILE *configFile, unsigned short version, TWMWinConfigEntry **pentry) |
| static void | SaveYourselfPhase2CB (SmcConn smcCon, SmPointer clientData) |
| static void | DieCB (SmcConn smcCon, SmPointer clientData) |
| static void | SaveCompleteCB (SmcConn smcCon, SmPointer clientData) |
| static void | ShutdownCancelledCB (SmcConn smcCon, SmPointer clientData) |
| static void | ProcessIceMsgProc (XtPointer client_data, int *source, XtInputId *id) |
| static int | write_byte (FILE *file, unsigned char b) |
| static int | write_ushort (FILE *file, unsigned short s) |
| static int | write_short (FILE *file, short s) |
| static int | write_int (FILE *file, int i) |
| static int | write_counted_string (FILE *file, char *string) |
| static int | read_byte (FILE *file, unsigned char *bp) |
| static int | read_ushort (FILE *file, unsigned short *shortp) |
| static int | read_short (FILE *file, short *shortp) |
| static int | read_int (FILE *file, int *intp) |
| static int | read_counted_string (FILE *file, char **stringp) |
| void | ReadWinConfigFile (char *filename) |
| int | GetWindowConfig (TwmWindow *theWindow, short *x, short *y, unsigned short *width, unsigned short *height, bool *iconified, bool *icon_info_present, short *icon_x, short *icon_y, bool *width_ever_changed_by_user, bool *height_ever_changed_by_user, int *occupation) |
| static char * | unique_filename (char *path, char *prefix, int *fd) |
| void | ConnectToSessionManager (char *previous_id) |
| void | shutdown_session (void) |
Variables | |
| SmcConn | smcConn = NULL |
| static XtInputId | iceInputId |
| static char * | twm_clientId |
| static TWMWinConfigEntry * | winConfigHead = NULL |
| static bool | sent_save_done = false |
| #define PATH_MAX 1023 |
Definition at line 876 of file session.c.
Referenced by SaveYourselfPhase2CB().
| #define SAVEFILE_VERSION 2 |
Definition at line 98 of file session.c.
Referenced by ReadWinConfigFile(), and SaveYourselfPhase2CB().
| void ConnectToSessionManager | ( | char * | previous_id | ) |
Definition at line 1118 of file session.c.
References appContext, ConnectToSessionManager(), DieCB(), iceInputId, ProcessIceMsgProc(), ProgramName, SaveCompleteCB(), SaveYourselfCB(), ShutdownCancelledCB(), smcConn, and twm_clientId.
Referenced by ConnectToSessionManager(), and ctwm_main().
|
static |
Definition at line 1075 of file session.c.
References DieCB(), DoShutdown(), and iceInputId.
Referenced by ConnectToSessionManager(), and DieCB().
|
static |
Definition at line 103 of file session.c.
References dpy, and GetClientID().
Referenced by GetClientID(), GetWindowConfig(), and SaveYourselfPhase2CB().
| int GetWindowConfig | ( | TwmWindow * | theWindow, |
| short * | x, | ||
| short * | y, | ||
| unsigned short * | width, | ||
| unsigned short * | height, | ||
| bool * | iconified, | ||
| bool * | icon_info_present, | ||
| short * | icon_x, | ||
| short * | icon_y, | ||
| bool * | width_ever_changed_by_user, | ||
| bool * | height_ever_changed_by_user, | ||
| int * | occupation ) |
Definition at line 704 of file session.c.
References TWMWinConfigEntry::class, TwmWindow::class, TWMWinConfigEntry::client_id, dpy, GetClientID(), GetWindowConfig(), GetWindowRole(), TWMWinConfigEntry::height, TWMWinConfigEntry::height_ever_changed_by_user, TWMWinConfigEntry::icon_info_present, TWMWinConfigEntry::icon_x, TWMWinConfigEntry::icon_y, TWMWinConfigEntry::iconified, TwmWindow::name, TWMWinConfigEntry::next, TWMWinConfigEntry::occupation, TWMWinConfigEntry::tag, TwmWindow::w, TWMWinConfigEntry::width, TWMWinConfigEntry::width_ever_changed_by_user, winConfigHead, TWMWinConfigEntry::window_role, TWMWinConfigEntry::wm_command, TWMWinConfigEntry::wm_command_count, TWMWinConfigEntry::wm_name, TWMWinConfigEntry::x, and TWMWinConfigEntry::y.
Referenced by AddWindow(), and GetWindowConfig().
|
static |
Definition at line 143 of file session.c.
References dpy, and GetWindowRole().
Referenced by GetWindowConfig(), GetWindowRole(), and SaveYourselfPhase2CB().
|
static |
Definition at line 1108 of file session.c.
References ProcessIceMsgProc().
Referenced by ConnectToSessionManager(), and ProcessIceMsgProc().
|
static |
Definition at line 240 of file session.c.
References read_byte().
Referenced by read_byte(), read_counted_string(), and ReadWinConfigEntry().
|
static |
Definition at line 295 of file session.c.
References read_byte(), and read_counted_string().
Referenced by read_counted_string(), and ReadWinConfigEntry().
|
static |
Definition at line 279 of file session.c.
References read_int().
Referenced by read_int(), and ReadWinConfigEntry().
|
static |
Definition at line 263 of file session.c.
References read_short().
Referenced by read_short(), and ReadWinConfigEntry().
|
static |
Definition at line 250 of file session.c.
References read_ushort().
Referenced by read_ushort(), ReadWinConfigEntry(), and ReadWinConfigFile().
|
static |
Definition at line 512 of file session.c.
References TWMWinConfigEntry::class, TWMWinConfigEntry::client_id, TWMWinConfigEntry::height, TWMWinConfigEntry::height_ever_changed_by_user, TWMWinConfigEntry::icon_info_present, TWMWinConfigEntry::icon_x, TWMWinConfigEntry::icon_y, TWMWinConfigEntry::iconified, TWMWinConfigEntry::occupation, read_byte(), read_counted_string(), read_int(), read_short(), read_ushort(), ReadWinConfigEntry(), TWMWinConfigEntry::width, TWMWinConfigEntry::width_ever_changed_by_user, TWMWinConfigEntry::window_role, TWMWinConfigEntry::wm_command, TWMWinConfigEntry::wm_command_count, TWMWinConfigEntry::wm_name, TWMWinConfigEntry::x, and TWMWinConfigEntry::y.
Referenced by ReadWinConfigEntry(), and ReadWinConfigFile().
| void ReadWinConfigFile | ( | char * | filename | ) |
Definition at line 666 of file session.c.
References TWMWinConfigEntry::next, read_ushort(), ReadWinConfigEntry(), ReadWinConfigFile(), SAVEFILE_VERSION, and winConfigHead.
Referenced by ctwm_main(), and ReadWinConfigFile().
|
static |
Definition at line 1087 of file session.c.
References SaveCompleteCB().
Referenced by ConnectToSessionManager(), and SaveCompleteCB().
|
static |
Definition at line 1057 of file session.c.
References SaveYourselfCB(), SaveYourselfPhase2CB(), and sent_save_done.
Referenced by ConnectToSessionManager(), and SaveYourselfCB().
|
static |
Definition at line 879 of file session.c.
References Argc, Argv, ScreenInfo::FirstWindow, GetClientID(), GetWindowRole(), TwmWindow::next, NumScreens, PATH_MAX, SAVEFILE_VERSION, SaveYourselfPhase2CB(), ScreenList, sent_save_done, twm_clientId, unique_filename(), TwmWindow::w, write_ushort(), and WriteWinConfigEntry().
Referenced by SaveYourselfCB(), and SaveYourselfPhase2CB().
| void shutdown_session | ( | void | ) |
Definition at line 1174 of file session.c.
References shutdown_session(), and smcConn.
Referenced by DoRestart(), and shutdown_session().
|
static |
Definition at line 1097 of file session.c.
References sent_save_done, and ShutdownCancelledCB().
Referenced by ConnectToSessionManager(), and ShutdownCancelledCB().
|
static |
Definition at line 839 of file session.c.
References unique_filename().
Referenced by SaveYourselfPhase2CB(), and unique_filename().
|
static |
Definition at line 160 of file session.c.
References write_byte().
Referenced by write_byte(), write_counted_string(), and WriteWinConfigEntry().
|
static |
Definition at line 217 of file session.c.
References write_byte(), and write_counted_string().
Referenced by write_counted_string(), and WriteWinConfigEntry().
|
static |
Definition at line 201 of file session.c.
References write_int().
Referenced by write_int(), and WriteWinConfigEntry().
|
static |
Definition at line 184 of file session.c.
References write_short().
Referenced by write_short(), and WriteWinConfigEntry().
|
static |
Definition at line 170 of file session.c.
References write_ushort().
Referenced by SaveYourselfPhase2CB(), write_ushort(), and WriteWinConfigEntry().
|
static |
Definition at line 370 of file session.c.
References TwmWindow::attr, TwmWindow::class, dpy, TwmWindow::frame_x, TwmWindow::frame_y, TwmWindow::heightEverChangedByUser, TwmWindow::icon, TwmWindow::isicon, JunkBW, JunkDepth, JunkHeight, JunkRoot, JunkWidth, LookInList(), TwmWindow::name, TwmWindow::nameChanged, TwmWindow::occupation, Scr, ScreenList, Icon::w, TwmWindow::w, TwmWindow::widthEverChangedByUser, write_byte(), write_counted_string(), write_int(), write_short(), write_ushort(), and WriteWinConfigEntry().
Referenced by SaveYourselfPhase2CB(), and WriteWinConfigEntry().
|
static |
Definition at line 78 of file session.c.
Referenced by ConnectToSessionManager(), and DieCB().
|
static |
Definition at line 81 of file session.c.
Referenced by SaveYourselfCB(), SaveYourselfPhase2CB(), and ShutdownCancelledCB().
| SmcConn smcConn = NULL |
Definition at line 77 of file session.c.
Referenced by ConnectToSessionManager(), and shutdown_session().
|
static |
Definition at line 79 of file session.c.
Referenced by ConnectToSessionManager(), and SaveYourselfPhase2CB().
|
static |
Definition at line 80 of file session.c.
Referenced by GetWindowConfig(), and ReadWinConfigFile().