|
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, DieCB(), iceInputId, ProcessIceMsgProc(), ProgramName, SaveCompleteCB(), SaveYourselfCB(), ShutdownCancelledCB(), smcConn, and twm_clientId.
Referenced by ctwm_main().
|
static |
Definition at line 1075 of file session.c.
References DoShutdown(), and iceInputId.
Referenced by ConnectToSessionManager().
|
static |
Definition at line 103 of file session.c.
References dpy.
Referenced by 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 TwmWindow::class, dpy, GetClientID(), GetWindowRole(), TwmWindow::name, ptr, TwmWindow::w, winConfigHead, x, and y.
Referenced by AddWindow().
|
static |
Definition at line 143 of file session.c.
References dpy.
Referenced by GetWindowConfig(), and SaveYourselfPhase2CB().
|
static |
Definition at line 1108 of file session.c.
Referenced by ConnectToSessionManager().
|
static |
Definition at line 240 of file session.c.
Referenced by read_counted_string(), and ReadWinConfigEntry().
|
static |
Definition at line 295 of file session.c.
References len, and read_byte().
Referenced by ReadWinConfigEntry().
|
static |
Definition at line 279 of file session.c.
Referenced by ReadWinConfigEntry().
|
static |
Definition at line 263 of file session.c.
Referenced by ReadWinConfigEntry().
|
static |
Definition at line 250 of file session.c.
Referenced by 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(), 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 ReadWinConfigFile().
| void ReadWinConfigFile | ( | char * | filename | ) |
Definition at line 666 of file session.c.
References TWMWinConfigEntry::next, read_ushort(), ReadWinConfigEntry(), SAVEFILE_VERSION, and winConfigHead.
Referenced by ctwm_main().
|
static |
Definition at line 1087 of file session.c.
Referenced by ConnectToSessionManager().
|
static |
Definition at line 1057 of file session.c.
References SaveYourselfPhase2CB(), and sent_save_done.
Referenced by ConnectToSessionManager().
|
static |
Definition at line 879 of file session.c.
References Argc, Argv, ScreenInfo::FirstWindow, GetClientID(), GetWindowRole(), TwmWindow::next, NumScreens, PATH_MAX, SAVEFILE_VERSION, ScreenList, sent_save_done, twm_clientId, unique_filename(), TwmWindow::w, write_ushort(), and WriteWinConfigEntry().
Referenced by SaveYourselfCB().
| void shutdown_session | ( | void | ) |
|
static |
Definition at line 1097 of file session.c.
References sent_save_done.
Referenced by ConnectToSessionManager().
|
static |
Definition at line 839 of file session.c.
Referenced by SaveYourselfPhase2CB().
|
static |
Definition at line 160 of file session.c.
Referenced by write_counted_string(), and WriteWinConfigEntry().
|
static |
Definition at line 217 of file session.c.
References write_byte().
Referenced by WriteWinConfigEntry().
|
static |
Definition at line 201 of file session.c.
Referenced by WriteWinConfigEntry().
|
static |
Definition at line 184 of file session.c.
Referenced by WriteWinConfigEntry().
|
static |
Definition at line 170 of file session.c.
Referenced by SaveYourselfPhase2CB(), 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(), and write_ushort().
Referenced by SaveYourselfPhase2CB().
|
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().